package predicates;

import entities.Search;
import interfaces.CandidateCapable;
import interfaces.SearchCapable;
import util.filter.Predicate;

/**
 *
 * @author damianfernandez
 * @param <T>
 */
public class CandidateCapableSearchCapablePredicate<T extends CandidateCapable> implements Predicate<T>, SearchCapable{
    private Search search;
    
    public CandidateCapableSearchCapablePredicate(){
        search=new Search();
    }
    
    public CandidateCapableSearchCapablePredicate(Search search){
        this.search=search;
    }
    
    @Override
    public boolean test(T o) {
        return search.test(o.getCandidate());
    }

    @Override
    public Search getSearch() {
        return search;
    }
    
}
